import webevent.events as events
from webevent.models import WebEnvents
from webevent.serializers import WebEventSerializer

def readReportLogs(user, ext_pk):
  try:
    logs = WebEnvents.objects.filter(user=user, ext_pk=ext_pk, event__in=[events.login, events.experimentIn, events.experimentKeyEvents, events.experimentReportIn, events.experimentReportKeyEvents, events.experimentVisible, events.experimentOut]).all()[:1000]
    return logs
    # return WebEventSerializer(logs).data
  except WebEnvents.DoesNotExist:
    return []